#!/bin/sh
INFILE=$1
echo $INFILE
OUTFILE=$(basename "$1" .flac).ogg
DIRNAME=$(dirname "$1"|sed -e 's/flac/ogg/g')  
echo $DIRNAME/$OUTFILE

if [ ! -d "$DIRNAME" ]; then
	mkdir -p "$DIRNAME"
fi

if [ ! -z "$1" ]; then
	opusenc --bitrate 22 --framesize 20 "${INFILE}" "${DIRNAME}/${OUTFILE}" 
fi
